import pymysql
import settings


class MysqlCon(object):
    """
    数据库链接类
    con_odsdb
    """

    def con_odsdb(self):
        connect = pymysql.connect(
            host=settings.MYSQL_CONN_odsdb["HOST"],
            user=settings.MYSQL_CONN_odsdb["USER"],
            passwd=settings.MYSQL_CONN_odsdb["PASSWD"],
            db=settings.MYSQL_CONN_odsdb["DB"],
        )

        cursor = connect.cursor()
        print("链接数据库con_odsdb成功")
        return connect, cursor

    